home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 37 / Amiga Format CD37 (1999-02-16)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-03].iso / -screenplay- / shareware / invasionforce / source / misc / addcommas.rexx next >
OS/2 REXX Batch file  |  1999-01-09  |  515b  |  24 lines

  1.  
  2. /* AddCommas.rexx - add a comma to each line of a text file */
  3.  
  4. parse arg filename
  5. if ~open('infile',filename,'r') then do
  6.         say "Sorry, can't read" filename "."
  7.         exit
  8. end
  9. call open('outfile',"T:OUTPUT",'w')
  10. line=readln('infile')
  11. do while ~eof('infile')
  12.         line=line","
  13.         call writeln('outfile',line)
  14.         line=readln('infile')
  15. end
  16. call close('infile')
  17. call close('outfile')
  18.  
  19. address command "copy T:OUTPUT to" filename
  20. address command "delete >nil: T:OUTPUT"
  21.  
  22. exit
  23. /* end of listing */
  24.